package verappdesktop.core;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.List;
import java.util.Map;

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import verappdesktop.views.GraphView;
import verappdesktop.views.OptionsView;

public class VerappDesktop extends JFrame{
	private static List<Variable> availableVariables;
	@SuppressWarnings("unused")
	private VerappDesktop(){
		availableVariables = null;
	}
	
	protected VerappDesktop(String title, List<Variable> variables){
		super(title);
		
		availableVariables = variables;
		
		setSize(800,600);
		setLayout(new BoxLayout(getContentPane(), BoxLayout.X_AXIS));
		GraphView graphPanel = new GraphView();
		graphPanel.setPreferredSize(new Dimension(600,600));
		OptionsView optionsPanel = new OptionsView(graphPanel);
		optionsPanel.setLayout(new GridLayout(availableVariables.size(),1));
		JScrollPane scrollable = new JScrollPane(optionsPanel);
		scrollable.setPreferredSize(new Dimension(200,600));
		add(graphPanel);
		add(scrollable);
		setVisible(true);
	}
	
	public static List<Variable> getAvailableVariables(){
		return availableVariables;
	}
}
